Introduction

The Velo Game Controller is a bicycle which is used to control computer games. It acts as a USB game controller (more or less a joystick). With the bike, you can control the speed, steering and one button on the brake is for shooting or so. Every game controllable by a joystick can be played. For now, SuperTuxKart was used in a 2 player mode with two bikes.

Techniques

Measuring the angle of the steering can not be done straight forward because the bike steering has an angle of more than 360°, but a potentiometer has only around 270°. Usually not the whole possible range is needed, but the potentiometer will be destroyed if you turn the steering bar to far.
As a solution, I place a magnet on the steering axle and measure the magnetic field with two Hall effect sensors. Two of them are needed to decide the direction of the steering, but it also extends the range. The possible range is quite narrow, but enough that it feels natural.
Image of the magnet and the two Hall effect sensors.Closeup of the previous image
Measuring of the steering angle with two Hall effect sensors and a magnet.

To measure the velocity, I use the dynamo of the bike. Dynamos have the property that they give maximum voltage at a very low speed. This makes absulutely sense since the intention is to supply a lamp.
Unfortunately, this also means that the voltage can not be used to measure the speed. As a solution, I use the frequency of the phase. This is linear with the speed and does not even include an ADC.
Measuring with an magnet at the wheel and a hall sensor would have the same effect. In contrast to the implemented solution, the update of the speed is very slow, in fact, to slow to have a reasonable reaction time.

Implementation

The PIC18F14K50 is used as controller. It has built in USB and does only need a few external components.
The software includes the following features:

The print is quite easy as I don't need a lot of stuff.
Schematic of the print as SVG file.
I used a prototype print to build them and a off the shelf case to put them into it.
Image of the first print.Image of the second print where the connector and UI is connected.

Using with SuperTuxKart

SuperTuxKart is a good game to use with the Velo Game Controller since it is made for fun and is not a precise simulation. Unfortunately, many buttons are needed to play the game as you can shoot, use nitrogen, do a sharp turn, show back and let you rescue if you are too far off course.

Nitrogen is a problem as it is difficult to win when the AI players can use it. A simple solution is to make the effect of nitrogen worthless. This is done by changing the line <nitro power-boost="3" consumption="1" small-container="1" big-container="3" max-speed-increase="5" duration="1" fade-out-time="2"/> in the configuration file "/usr/share/games/supertuxkart/data/stk_config.xml" to <nitro power-boost="0" consumption="1" small-container="0" big-container="0" max-speed-increase="0" duration="0" fade-out-time="0"/>

Sharp turns are more difficult. One solution is to change the uC software that you do a sharp turn whenever you leaving the steering range. The reason why I didn't implemented this is, that it is a workaround only for one game and it does not behave as a game controller should. As a result, you should choose tracks where no sharp turns are needed.

Showing back is not really needed to play the game. The rescue feature is nice, but when you don't drive to bad you don't need it ;).

Downloads